package com.testmanager.testmananger.quantitative.constants;

import com.testmanager.testmananger.foundation.domain.enums.EnumBase;

import java.util.Arrays;

public enum BugStatus implements EnumBase {
        NEW("新缺陷",0),
    Fixing("修理中",2),
    Fixed("已修复",3),
    Closed("已关闭",4),

    designed("设计如此",5),
    mistake("误提",6),
    SOMETIMES("偶现",7),
    //REFUSEFIX("不修复",8),
    unFixed("未修复",1),
    ;

    public static final String CODE = "demand_type";
    private final String name;
    private final Integer value;

    BugStatus(String name , int value){
        this.name = name;
        this.value=value;
    }
    public static BugStatus getValueOf(Integer value){

        return Arrays.stream(BugStatus.values())
                .filter(t->t.getValue().equals(value))
                .findFirst()
                .orElse(BugStatus.NEW);
    }


    @Override
    public String getName() {
        return name;
    }

    @Override
    public Integer getValue() {
        return value;
    }
}
